package com.elsa.smart_buffet.controller;

import com.elsa.smart_buffet.pojo.ResultBox.CallBackMessage;
import com.elsa.smart_buffet.pojo.ResultBox.ResponseResult;
import com.elsa.smart_buffet.service.YearService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName : YearController  //类名
 * @Author : elsa //作者
 */
@RestController
@CrossOrigin
public class YearController {

    @Autowired
    private YearService yearService;

    @GetMapping("/getYearIncome")
    public ResponseResult getYearIncome() {
        return new ResponseResult(CallBackMessage.SUCCESS, yearService.getYearIncome());
    }

    @GetMapping("/getTotalIncome")
    public ResponseResult getTotalIncome() {
        return new ResponseResult(CallBackMessage.SUCCESS, yearService.getTotalIncome());
    }

}
